(require 'cl)

(defun thesaurus--trim-trailing-newlines (string)
  (while (string-match "\\(.*\\)\\(\n\\|\r\\)$" string)
    (setq string (substring string 0 -1))) ;; remove newline
  string)

(require 'thesaurus)
(setq thesaurus-bhl-api-key "ecbd733216115b7ea8ee1dbcdc2fe26b")
(define-key global-map (kbd "C-x t") 'thesaurus-choose-synonym-and-replace)

(fset 'xwp-kmacro-thesaurus-choose-synonym-and-replace
   (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([24 116 return] 0 "%d")) arg)))
(define-key global-map (kbd "<S-f5>") 'xwp-kmacro-thesaurus-choose-synonym-and-replace) 
(provide 'thesaurus-setting)
